#ifndef __LOG__
#define __LOG__
#include "server.h"
#include <errno.h>
#include <syslog.h>
#define  NETDISK_LOG(username){  \
        time_t now=time(NULL);            \
        syslog(LOG_INFO,"user:%s,login time:%s",username,ctime(&now));  \
}

//用户操作
#define  NETDISK_LOG_INFO(username,operation,msg){  \
        time_t now=time(NULL);            \
        syslog(LOG_INFO,"user:%s,operation:%s,msg:%s,time:%s",username,operation,msg,ctime(&now));  \
}

#define NETDISK_LOG_DEBUG(retVal,ret){          \
        if(retVal == ret){\
          syslog(LOG_ERR,"Error in file:%s,function:%s,line:%d,Error msg:%s",__FILE__,__FUNCTION__,__LINE__,strerror(errno));   \
                  }\
}


#endif
